//
//  ChuFangModelDefault.m
//  xy_hehu
//
//  Created by pac on 2019/6/11.
//  Copyright © 2019 pac. All rights reserved.
//

#import "ChuFangModelDefault.h"

@implementation ChuFangModelDefault

+ (void)saveModelToDictionaryWith:(NSArray*)array{
    NSMutableDictionary * dict = [[NSMutableDictionary alloc]init];
    for (NSDictionary * ddd in array) {
        [dict setValue:[NSString stringWithFormat:@"%@",ddd[@"pname"]] forKey:[NSString stringWithFormat:@"%@",ddd[@"partid"]]];
    }
    
    if (dict) {
        NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
        [defaults setObject:dict forKey:@"ChuFangModelDefault"];
        [defaults synchronize];
    }
    
    [self getAllModelData];
    
}
+ (NSDictionary *)getAllModelData{
    
    NSDictionary * dict = [[NSUserDefaults standardUserDefaults] objectForKey:@"ChuFangModelDefault"];
    return dict;
//    if (dict == nil) {
//        return @{};
//    }else{
//        return dict;
//    }
}

@end
